function ff=Saddle(kk)
 
k=kk; % endogenous lagrangian multipliers at time 0

global pi1 pi2 betta delta varxi xaut yaut x_target y_target time 

%%%%%%%%% time t=0 %%%%%%%%%

x(1)= ((betta/delta)/(1+k)); % consumption share of old state 1

if betta/delta>yaut
    y(1)=betta/delta;
else
    y(1)=yaut;
end

for i=1:time;
    
   % consumption share of old state 2
   if (betta/delta)*(1+pi1*(((y(i)-x(i))/(x(i)))))>yaut;
        y(i+1)=(betta/delta)*(1+pi1*(((y(i)-x(i))/(x(i)))));
    else
        y(i+1)=yaut;
    end 
   % consumption share of old state 1     
   x(i+1)=((varxi*(1+x(i))^((1/(betta*pi1)))*(((1+y(i+1))/(y(i+1))))...
       ^(((pi2)/(pi1))))/(1-varxi*(1+x(i))^((1/(betta*pi1)))...
       *(((1+y(i+1))/(y(i+1))))^(((pi2)/(pi1)))));    
end

xs=x(time);
ys=y(time);
 
% equation to target
ff(1)=xs-x_target;
ff(2)=ys-y_target;
